package Day09.Test;

import java.util.ArrayList;

public class Test03 {
    public static void main(String[] args) {
        /*有如下字符串数组String[] arr =   {"张三","李四","王五","赵六","田七","周八","陈九"}
将数组中的元素,存入ArrayList集合中，并完成如下操作：
1.删除陈九
2.打印集合此时的长度
3.将集合中"赵六"改成"赵信"
4.遍历打印此时的集合*/
        ArrayList<String> list=new ArrayList<>();
        String[] arr={"张三","李四","王五","赵六","田七","周八","陈九"};
        for (int i = 0; i < arr.length; i++) {
            list.add(arr[i]);
        }
        list.remove("陈九");
        System.out.println(list.size());
        for (int i = 0; i < list.size(); i++) {
            String s=list.get(i);
            if(s.equals("赵六")){
                s="赵信";
            }
            System.out.println(s);
        }

    }
}
